package com.jstyle.beatecg.util;


import com.jstyle.beatecg.model.NetResultData;

/**
 * Created by Administrator on 2017/4/14.
 */

public class NetWorkException extends RuntimeException {
    NetResultData netResultData;
    String message;

    public NetResultData getNetResultData() {
        return netResultData;
    }

    public NetWorkException(NetResultData netResultData){
        this.netResultData=netResultData;
    }
    public NetWorkException(String message){
            this.message=message;
    }

    public int getMsgCode(){
        return this.netResultData==null?1111:this.netResultData.getMsgCode();
    }
    @Override
    public String getMessage() {
        return netResultData==null?message:netResultData.getMsgInfo();
    }
}
